Skip to main content link. Accesskey S
  • Help
  • HCL Logo
  • HCL Notes and Domino Application Development wiki
  • THIS WIKI IS READ-ONLY. Individual names altered for privacy purposes.
  • HCL Forums and Blogs
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • API Documentation
Search
Community Articles > Developing Applications > Developing XPage Applications > Making a read only field be required
  • Share Show Menu▼
  • Subscribe Show Menu▼

Recent articles by this author

Make a field required when emulating computed when composed

1) Set visible property to true 2) create a computed field with the formula: getComponent(Id of above field).getValue() 3) select source tab and enter the div tag before and div tag after your field code as below, but not to include your computed field The reason for doing it this way is ...

Making a read only field be required

Validating a Read Only field By default a field set to be read only cannot be required, but with a little help from my friend Chris Toohey you can add a div tag with a style to make it work like shown below: div style"display: none;"      xp:inputText           id"rptToName1" ...

Computed Datasource Application

If you are required to develop in a development environment before going to production, then the below might be helpful if you need to use another database for your datasource where there is a copyreplica of this in your development environment and production environment. var curServer ...
Community articleMaking a read only field be required
Added by ~Martha Refanater on August 26, 2011 | Version 1
  • Actions Show Menu▼
expanded Abstract
collapsed Abstract
No abstract provided.
ShowTable of Contents
HideTable of Contents
  • 1 Validating a Read Only field

Validating a Read Only field

By default a field set to be read only cannot be required, but with a little help from my friend Chris Toohey you can add a div tag with a style to make it work like shown below:

<div style="display: none;">

      <xp:inputText
           id="rptToName1"
           value="#{xp_record.RptToName}"
           required="#{javascript:return submittedBy( 'questionairreBtn1' )}" styleClass="tableCellLabelLeftNormal">
           <xp:this.validators>
                <xp:validateRequired message="Who this position reports to is required"></xp:validateRequired>
           </xp:this.validators>

     </xp:inputText>

 </div>

The field property should have read only deselected and the visible property can be either or, then you create a visible computed field that uses the value of the now hidden control which is required and magically it works like a charm.  I have also submitted this idea - xPages Required Property - on IdeaJam about this

Dwain A Wuerfel


  • Actions Show Menu▼


expanded Attachments (0)
collapsed Attachments (0)
Edit the article to add or modify attachments.
expanded Versions (1)
collapsed Versions (1)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (1)Aug 26, 2011, 5:24:37 PM~Martha Refanater  
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedAbout
  • HCL Software
  • HCL Digital Solutions community
  • HCL Software support
  • BlogsDigital Solutions blog
  • Community LinkHCL Software forums and blogs
  • About HCL
  • Privacy
  • Accessibility